home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Trusted Irix /B 4.0.4
/
Trusted-Irix B-4.0.1.iso
/
dist
/
eoe1.idb
/
usr
/
include
/
sys
/
types.h.z
/
types.h
Wrap
C/C++ Source or Header
|
1992-04-03
|
4KB
|
118 lines
/**************************************************************************
* *
* Copyright (C) 1990, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
**************************************************************************/
/* Copyright (c) 1984 AT&T */
/* All Rights Reserved */
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
#ifndef __SYS_TYPES_H__
#define __SYS_TYPES_H__
#pragma once
#ident "$Revision: 3.17 $"
typedef struct { int r[1]; } * physadr;
typedef long daddr_t; /* <disk address> type */
typedef char * caddr_t; /* ?<core address> type */
typedef unsigned char unchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
typedef ulong ino_t; /* <inode> type */
typedef short cnt_t; /* ?<count> type */
#ifndef _TIME_T_
#define _TIME_T_
typedef long time_t; /* <time> type */
#endif /* !_TIME_T_ */
typedef int label_t[12]; /* sync with NJBREGS in pcb.h */
typedef short dev_t; /* <old device number> type */
typedef long off_t; /* ?<offset> type */
typedef unsigned long paddr_t; /* <physical address> type */
typedef int key_t; /* IPC key type */
typedef unsigned char use_t; /* use count for swap. */
typedef short sysid_t;
typedef short index_t;
typedef unsigned int lock_t; /* <spinlock> type */
typedef signed char cpuid_t; /* cpuid */
#ifndef _SIZE_T_
#define _SIZE_T_
typedef unsigned size_t; /* the unsigned integral type of the result
of the sizeof operator */
#endif /* !_SIZE_T_ */
#ifdef _BSD_COMPAT
/*
* Basic system types from 4.2 (Needed for 4.2 driver ports)
* ( internal major/minor device constructing/busting macros
* that are used in the kernel are found in sys/sysmacros.h )
*/
/* major part of a device external from the kernel */
#define major(x) (int)(((unsigned)(x)>>8)&0x7F)
/* minor part of a device */
#define minor(x) (int)((x)&0xFF)
/* make a device number */
#define makedev(x,y) (dev_t)(((x)<<8) | (y))
typedef struct _quad { long val[2]; } quad;
#endif /* _BSD_COMPAT */
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef long swblk_t;
typedef u_short uid_t;
typedef u_short gid_t;
/* POSIX additions */
typedef int pid_t; /* proc & grp IDs (NOT kernel internal!) */
typedef short nlink_t; /* used for link counts */
typedef ushort mode_t; /* file attrs, eg. file type, access perms */
#define NBBY 8 /* number of bits in a byte */
/*
* Select uses bit masks of file descriptors in longs.
* These macros manipulate such bit fields (the filesystem macros use chars).
* FD_SETSIZE may be defined by the user, but the default here
* should be >= NOFILE (param.h).
*/
#ifndef FD_SETSIZE
#define FD_SETSIZE 256
#endif
#ifdef sgi
typedef unsigned long fd_mask;
#else
typedef long fd_mask;
#endif /* sgi */
#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */
#ifndef howmany
#define howmany(x, y) (((x)+((y)-1))/(y))
#endif
typedef struct fd_set {
fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
} fd_set;
#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
#endif /* __SYS_TYPES_H__ */